* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    max-width: 1200px;
    width: 100%;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-top: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.upload-area {
    border: 3px dashed #3498db;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s;
    background-color: #f8fafc;
    cursor: pointer;
}

.upload-area:hover {
    background-color: #e8f4fc;
    border-color: #2980b9;
}

.upload-icon {
    font-size: 60px;
    color: #3498db;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.upload-hint {
    color: #7f8c8d;
    font-size: 14px;
}

#imageInput {
    display: none;
}

.preview-section {
    display: none;
    margin-top: 30px;
}

.section-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.preview-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.preview-item {
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    background-color: white;
    max-width: 300px;
}

.preview-img {
    width: 100%;
    display: block;
}

.preview-label {
    background-color: #3498db;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 14px;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.page-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 16px;
    color: #495057;
}

.page-info strong {
    color: #3498db;
}

.option-group {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.option-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.option-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #ecf0f1;
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    margin-bottom: 10px;
    color: #7f8c8d;
    display: none;
}

.overlap-option {
    margin-top: 10px;
    padding: 10px;
    background-color: #e8f4fc;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.overlap-slider {
    margin-top: 10px;
    width: 100%;
}

.slider-value {
    text-align: center;
    color: #3498db;
    font-weight: bold;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .preview-container {
        justify-content: center;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .option-row {
        flex-direction: column;
    }
}